<template>
  <transition name="drop">
    <div class="top-tip" v-show="showFlag" @click.stop="hide">
      <slot></slot>
    </div>
  </transition>
</template>

<script>
  export default {
    name: 'topTips',
    data() {
      return {
        showFlag: false
      }
    },
    methods: {
      show() {
        this.showFlag = true
        clearTimeout(this.time)
        this.time = setTimeout(() => {
          this.showFlag = false
        }, 2000)
      },
      hide() {
        this.showFlag = false
      }
    }
  }

</script>
